<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" href="/favicon.ico" />
    <!-- <meta name="viewport" content="width=device-width, initial-scale=1.0" /> -->
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no, viewport-fit=cover" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <!-- <script type="text/javascript" src="https://api.map.baidu.com/getscript?v=1.0&type=webgl&ak=2hdKtGq5POwaclkAd1ADMnVNDmMuQDoF"></script> -->
    <link rel="stylesheet" href="/css/base-style.css?v=1.08">
    <link rel="stylesheet" href="/iconfont/iconfont.css?v=1.1">
    <style>
      .initBack{
        position:fixed;
        z-index: 10;
        left: 1.2rem;
        top: 1.2rem;
      }
      .initBack img{
        display: block;
        width: 2.2rem;
      }
    </style>
    <title>元界</title>
  </head>
  <body>
    <div id="app"></div>
    <div class="initBack" id="initBackBtn"><img src="/images/back.png"/></div>
    <script type="module" src="/src/main.js"></script>

    <script>
      function initH5CallAPPFuction(appFn){
          let u = navigator.userAgent
          let isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1 // android终端或者uc浏览器
          let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) // ios终端
          if (isAndroid) {
              window.Android[appFn](params) 
          } else if (isiOS) {
              window.webkit.messageHandlers[appFn].postMessage(params)
          }
      }
      var init_btnEle = document.getElementById('initBackBtn')
      init_btnEle.onclick = function(){
        
        try {
          initH5CallAPPFuction('backToHome','0') 
        } catch (error) {
            console.log("初始化调用app返回失败")
        } 
        // var init_historyState = window.history.state
        // console.log("init_historyState:",init_historyState)
        // if(init_historyState.back){ // 判断是否有上一页
        //   window.history.go(-1); 
        // }
      }
      
    </script>
  </body>
</html>
